word RAM model
word RAM,
word random-access machine
#complexity_theory
#complexity_theory
Definition
Define an algorithm in the word RAM model of computation as follows:
- Input, output, working memory are each represented as arrays. Initially, input is written while the output and working memory are blank.
- Each entry in an array can store an integer or floating-point number (or arbitrary-precision real numbers) represented in binary up to a certain length. Or, entries may store characters (e.g. ASCII, Unicode).
- Maximum number of bits per entry is called the word size
- word is the unit of operations, for problem size
Algorithm is sequence of instructions each executing in constant time , e.g.
- arithmetic operations on entries of arrays: add, subtract, multiply, divide, remainder, floor ceiling
- operations in constant time for numbers fitting in arrays
- exponentiation may require more care
- condition checks and branches (e.g. if statements)
- accessing any element of an array if we have its index (address) stored in a known location, this is the random access memory (RAM) component of the model. If array lengths , then location index requires bits to write down, word size at least this large.
We may further distinguish these operations taking constant time, by their circuit complexity:
- operations (see AC0): polynomial-size circuit in depth; bitwise logical operations, addition, subtraction, comparison, most significant bit
- : multiplication, division
Rank operation
The Rank operation is performed on the packed word containing keys, and the objective is to find the number of keys with value greater than . Hence, by subtracting = [0 q | 0 q | ... | 0q] from , where = [ 1 x_1 | 1 x_2 | ... | 1 x_k ] we obtain the rank from [c1 | 0 | c_2 | 0 ...] number of due to borrowing which would make if . Hence this is considered by using operations of subtraction and significant bits.
Notes
- word size is an important parameter of the model, assuming , number of elements stored in any of the data structures
- packed word when #incomplete
See also
- random access machine
- Turing machine
- transdichotomous model